import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsString, IsNotEmpty, IsEnum } from "class-validator";
import { PageDto } from "src/common/dto/dto";
import { SchoolStatus } from "src/dictionaries/index.enum";
export class GetUserPage extends PageDto {
    @ApiPropertyOptional({
        type: Number,
        name: 'id',
        description: 'id',
    })
    public readonly id: number;

    @ApiPropertyOptional({
        type: String,
        name: 'name',
        description: '学校名称',
    })
    public readonly name: string;

    @ApiPropertyOptional({
        type: Number,
        name: 'principalName',
        description: '校长姓名',
    })
    public readonly principalName: string;

    @ApiPropertyOptional({
        type: String,
        name: 'principalEmail',
        description: '校长校长邮箱姓名',
    })
    public readonly principalEmail: string;

    @ApiPropertyOptional({
        name: 'status',
        description: '学校状态',
        enum: SchoolStatus
      })
      public readonly status: SchoolStatus;
}
export class CreateSchoolDto {
    /** 学校名称 */
    @ApiProperty({ example: 'name', description: '学校名称' })
    @IsString()
    @IsNotEmpty()
    name: string;

    /** 学校地址 */
    @ApiPropertyOptional({ example: 'address', description: '学校地址' })
    address: string;

    /** 学校简介 */
    @ApiPropertyOptional({ example: 'introduction', description: '学校简介' })
    introduction: string;

}
export class UpdateSchoolDto extends CreateSchoolDto {
    @IsNotEmpty({ message: 'id不能为空' })
    @ApiProperty({
        type: Number,
        name: 'id',
        description: 'id',
    })
    public readonly id: number;

    @ApiPropertyOptional({
        type: Number,
        name: 'principalName',
        description: '校长姓名',
    })
    public readonly principalName: string;

    @ApiPropertyOptional({
        type: Number,
        name: 'principalEmail',
        description: '校长邮箱',
    })
    public readonly principalEmail: string;
}
export class ApprovedSchoolDto {
    @IsNotEmpty({ message: 'id不能为空' })
    @ApiProperty({
        type: Number,
        name: 'id',
        description: 'id',
    })
    public readonly id: number;
    @IsEnum(SchoolStatus) //枚举
    @ApiProperty({
      name: 'status',
      description: '0:保存草稿，1:发布，2:删除',
      enum: SchoolStatus
    })
    public readonly status: SchoolStatus
}